<!DOCTYPE html>
<html lang="zh-Hans-CN">

<head>
    <meta charset="UTF-8">
    <title>{%- block title -%}{%- endblock -%}</title>
    <meta name="author" content="邢栋">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta name="force-rendering" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <script>/*@cc_on window.location.href="https://support.dmeng.net/upgrade-your-browser.html?referrer="+encodeURIComponent(window.location.href); @*/</script>
    <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
</head>

<body>
    <a href="https://github.com/xclala/ShareFiles">
        <img src="https://xclala.gitee.io/github.svg">
    </a>
    <a href="{{ url_for('delete_session') }}">退出登录</a>
    <h1>{{ self.title() }}</h1>
    {% with messages = get_flashed_messages() %}
    {% if messages %}
    {% for message in messages %}
    <h6>{{ message }}</h6>
    {% endfor %}
    {% endif %}
    {% endwith %}
    <form id="form" method="post" enctype="multipart/form-data">
        <script>
            document.getElementById("form").action = window.location.href
        </script>
        <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
        {% block logic %}
        {% endblock %}
    </form>
    <div id="filelist">
        {% block newfile %}
        <button onclick="newfile()">新建文件</button>
        {% endblock %}
        <p></p>
        {% for fl in filelist %}
        <a href="/filelist/{{ filepath }}{{ fl }}">{{ fl }}</a>
        <a href="/edit/{{ filepath }}{{ fl }}">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;编辑</a>
        <a onclick="Delete('{{ filepath }}', '{{ fl }}')">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;删除<br></a>
        <p></p>
        {% endfor %}
    </div>
    <script src="{{ url_for('static', filename='script.js') }}"></script>
</body>

</html>